package zjt.demo3;

public class Yanghui {

        public static void main(String[] args) {
            int[][] arr = new int[10][10];
            for (int i = 0; i < arr.length; i++) {
                for (int j = 0; j <= i; j++) {
                    //根据规律，使用if else 赋值
                    if (j == 0 || j == i) {
                        arr[i][j] = 1;
                    } else {
                        arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
                    }
                    System.out.print(arr[i][j] + "\t");
                }
                System.out.println();
            }
        }
    }
